package com.bytedance.common.plugin.framework.util;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Map;
import java.util.Set;

public final class a<K,V> implements Map<K,V> {
    public Map<K,V> a;
    public Map<V,K> b;

    public a() {
        this.a = new HashMap();
        this.b = new HashMap();
    }

    public a(Map<K,V> arg1, Map<V,K> arg2) {

        this.a = arg1;
        this.b = arg2;
    }

    public final void clear() {
        this.a.clear();
        this.b.clear();
    }

    public final boolean containsKey(Object arg2) {
        return this.a.containsKey(arg2);
    }

    public final boolean containsValue(Object arg2) {
        return this.a.containsValue(arg2);
    }

    public final Set<Entry<K,V>> entrySet() {
        return Collections.unmodifiableSet(this.a.entrySet());
    }

    public final V get(Object arg2) {
        return this.a.get(arg2);
    }

    public final boolean isEmpty() {
        return this.a.isEmpty();
    }

    public final Set<K> keySet() {
        return Collections.unmodifiableSet(this.a.keySet());
    }

    public final V put(K arg2, V arg3) {
        this.a.put(arg2, arg3);
        this.b.put(arg3, arg2);
        return arg3;
    }

    public final void putAll(Map<? extends K, ? extends V> map) {
        for (Entry<? extends K, ? extends V> entry : map.entrySet()) {
            put(entry.getKey(), entry.getValue());
        }
    }


    public final V remove(Object obj) {
        if (!this.a.containsKey(obj)) {
            return null;
        }
        this.b.remove(this.a.get(obj));
        return this.a.remove(obj);
    }


    public final int size() {
        return this.a.size();
    }

    public final Collection values() {
        return Collections.unmodifiableCollection(this.a.values());
    }
}

